<template>
  <div class="rank_list_module">
    <header>
      <i class="iconfont icon-reset" />
    </header>
    <section>
      <div class="category">
        <span>日榜</span>
        <span>周榜</span>
        <span>月榜</span>
      </div>
      <div class="cube-container">
        <div class="column">
          <div class="title">
            <span>张三</span>
          </div>
          <div class="cube">
            <div class="square"></div>
            <div class="square"></div>
          </div>
        </div>
        <div class="column">
          <div class="title">
            <span>李四</span>
          </div>
          <div class="cube">
            <div class="square"></div>
            <div class="square"></div>
          </div>
        </div>
        <div class="column">
          <div class="title">
            <span>王五</span>
          </div>
          <div class="cube">
            <div class="square"></div>
            <div class="square"></div>
          </div>
        </div>
      </div>
    </section>
  </div>
</template>

<script lang="ts">
import Vue from 'vue'
import { Component } from 'vue-property-decorator'
@Component
class WSRanks extends Vue {}
export default WSRanks
</script>

<style lang="less" scoped>
@import '~@/styles/theme.less';
@import '~@/styles/layout.less';
.rank_list_module {
  position: relative;
  width: 100%;
  touch-action: none;
  #flex(column, flex-start, flex-start);
  header {
    width: 100%;
    height: 22px;
    margin-bottom: 5px;
    #flex(row, center, flex-end);
  }
  section {
    flex: 1;
    width: 100%;
    overflow: hidden;
    .category {
      margin-bottom: 20px;
      #flex(row, center, center);
      span {
        box-sizing: border-box;
        padding-right: 10px;
        margin-right: 10px;
        border-right: solid 1px;
        #color(color, --primary-text-color);
        #color(border-right-color, --primary-border-color);
      }
      span:last-child {
        padding: 0;
        margin: 0;
        border-right: 0;
      }
    }
    .cube-container {
      box-sizing: border-box;
      #flex(row, flex-end, center);
    }
    .cube {
      width: 100%;
      #flex(column, center, flex-start);
      .square:first-child {
        width: 90%;
        height: 25px;
        margin-bottom: 1px;
        transition: all 0.2s ease;
        transform: perspective(25px) rotateX(12deg);
        background: linear-gradient(#cbe0f408, #82c2e6);
        [data-theme='dark'] & {
          background: linear-gradient(#b0d6f508, #09b1ec);
        }
      }
      .square:last-child {
        width: 100%;
        height: 100px;
        transition: all 0.2s ease;
        background: linear-gradient(#5584b0, #cbe0f4);
        [data-theme='dark'] & {
          background: linear-gradient(#0487e2, #b0d6f5);
        }
      }
    }
    .column {
      min-width: 30%;
      transition: all 0.2s ease;
      #flex(column, center, flex-start);
      .title {
        font-size: 14px;
        #color(color, --primary-text-color);
      }
    }
    .column:first-child {
      transform: translateX(20px);
    }
    .column:last-child {
      transform: translateX(-20px);
    }
    .column:nth-child(2) {
      flex: 1;
      min-width: 33%;
      z-index: 2;
      .cube {
        width: 100%;
        margin: 0 -20px;
        .square:last-child {
          height: 150px;
        }
      }
    }
    .column:hover {
      .square:first-child,
      .square:last-child {
        #color(background-color, --primary-blue-color);
      }
    }
  }
}
</style>
